#ifndef __KEY_H__
#define __KEY_H__

#include <at89x52.h>
#include "MyType.h"

extern volatile uint8_t idata keyCurrent, keyOld, keyNoChangedTime;
extern volatile uint8_t idata KeyPress;
extern volatile uint8_t idata KeyDown,KeyUp, KeyLast;
extern volatile uint8_t keyCanChange;

void InitKeyBoard(void);
#define KeyIO	P1
#define GetKeyValue()	(~KeyIO)

#define KEY1	0x01
#define KEY2	0x02
#define KEY3	0x04
#define KEY4	0x08
#define KEY5	0x10
#define KEY6	0x20
#define KEY7	0x40
#define KEY8	0x80

#endif
